﻿using System.Windows;
using System.Windows.Controls;
using Shoozla.DataModel.Helper;
using Shoozla.DataModel;
using MahApps.Metro.Controls;
using Shoozla.ViewModel;


namespace Shoozla.View
{
    /// <summary>
    /// Interaction logic for SearchAddinView.xaml
    /// </summary>
    public partial class OptionsView : MetroWindow
    {

        public OptionsView()
        {
            InitializeComponent();       
            var viewmodel = new OptionsViewModel(this,App.MainView);
            DataContext = viewmodel;            
            viewmodel.RequestClose += (s, e) => this.Close();

        }

        private void addInCB_SelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            CoverSearcher cs = e.AddedItems[0] as CoverSearcher;
            if (cs != null)
            {
                addinDescLB.Content = cs.AddInDescription;
                addinDescLB.Visibility = System.Windows.Visibility.Visible;
            }
        }
    }
}
